package com.atguigu.petstore.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 商城-商品销售套餐
 * @TableName shop_product_entry
 */
@TableName(value ="shop_product_entry")
@Data
public class ShopProductEntry implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品销售套餐名
     */
    @TableField(value = "product_entry_name")
    private String productEntryName;

    /**
     * 关联商品id
     */
    @TableField(value = "product_id")
    private Long productId;

    /**
     * 销量
     */
    @TableField(value = "sale_count")
    private Integer saleCount;

    /**
     * 库存量
     */
    @TableField(value = "stock_count")
    private Integer stockCount;

    /**
     * 销售套餐价格
     */
    @TableField(value = "entry_price")
    private BigDecimal entryPrice;

    /**
     * 套餐原始价格
     */
    @TableField(value = "entry_origin_price")
    private BigDecimal entryOriginPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopProductEntry other = (ShopProductEntry) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getProductEntryName() == null ? other.getProductEntryName() == null : this.getProductEntryName().equals(other.getProductEntryName()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getSaleCount() == null ? other.getSaleCount() == null : this.getSaleCount().equals(other.getSaleCount()))
            && (this.getStockCount() == null ? other.getStockCount() == null : this.getStockCount().equals(other.getStockCount()))
            && (this.getEntryPrice() == null ? other.getEntryPrice() == null : this.getEntryPrice().equals(other.getEntryPrice()))
            && (this.getEntryOriginPrice() == null ? other.getEntryOriginPrice() == null : this.getEntryOriginPrice().equals(other.getEntryOriginPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProductEntryName() == null) ? 0 : getProductEntryName().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getSaleCount() == null) ? 0 : getSaleCount().hashCode());
        result = prime * result + ((getStockCount() == null) ? 0 : getStockCount().hashCode());
        result = prime * result + ((getEntryPrice() == null) ? 0 : getEntryPrice().hashCode());
        result = prime * result + ((getEntryOriginPrice() == null) ? 0 : getEntryOriginPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", productEntryName=").append(productEntryName);
        sb.append(", productId=").append(productId);
        sb.append(", saleCount=").append(saleCount);
        sb.append(", stockCount=").append(stockCount);
        sb.append(", entryPrice=").append(entryPrice);
        sb.append(", entryOriginPrice=").append(entryOriginPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}